package com.chen.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 网关路由配置
 *
 * @author chenguangde
 * @version 1.0
 * @Description
 * @createTime 2021年05月16日 16:14:00
 */
//@Configuration
public class RoutesConfig {

//    /**
//     * 健康检查的路由转发，测试例子
//     */
//    @Bean
//    public RouteLocator myRoutes(RouteLocatorBuilder builder) {
//        return builder.routes()
//                // Add a simple re-route from: /get to: http://httpbin.org:80
//                // Add a simple "Hello:World" HTTP Header
//                .route(p -> p
//                        .path("/get") // intercept calls to the /get path
//                        .filters(f -> f.addRequestHeader("Hello", "World")) // add header
//                        .uri("http://httpbin.org:80")) // forward to httpbin
//                .build();
//    }
}
